package com.crm.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.crm.domain.SysUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<SysUser> {

    void saveBatchRoleIds(Long userId, List<Long> roleIds);

    List<Long> selectRoleIds(Integer id);
    @Update("update sys_user set status = #{status} where user_id = #{userId}")
    void changeStatus(String status, Long userId);
    @Update("update sys_user set password = #{password} where user_id = #{userId}")
    void resetPwd(String password, Long userId);
    @Delete("delete from sys_user_role where user_id = #{userId}")
    void deleteRoleIds(Long userId);


}
